/**
 * 上海中赢金融信息服务有限公司
 * Copyright (c) 2017-2027 Chinazyjr,Inc.All Rights Reserved.
 */

package com.sys.midware.zookeeper.sample.zkclient;

import org.apache.zookeeper.Watcher;
import org.apache.zookeeper.ZooKeeper;

/**
 * <b>ClassName:</b> ZookeeperFactory.java <br/>
 * <b>Description:</b> TODO <br/>
 * <b>Date:</b>     2016年1月14日 下午2:35:13<br/> 
 * @author   mobing
 * @version  	 
 */
public interface ZookeeperFactory {

    /**
     * Allocate a new ZooKeeper instance
     *
     *
     * @param connectString the connection string
     * @param sessionTimeout session timeout in milliseconds
     * @param watcher optional watcher
     * @param canBeReadOnly if true, allow ZooKeeper client to enter
     *                      read only mode in case of a network partition. See
     *                      {@link ZooKeeper#ZooKeeper(String, int, Watcher, long, byte[], boolean)}
     *                      for details
     * @return the instance
     * @throws Exception errors
     */
    public ZooKeeper newZooKeeper(String connectString, int sessionTimeout, Watcher watcher, boolean canBeReadOnly) throws Exception;
}

